function [err_struct] = collectEvalMetrics(err_struct, arr_data, arr_ref,  ...
  asso_idx, max_asso_val, min_match_num, step_length, fps, rel_interval, benchmark_type, ...
  rm_iso_track, seq_start_time, valid_by_duration, rn)

arr_asso  = associate_track(arr_data, arr_ref, 1, max_asso_val);

if sum(arr_asso~=0) < 100
  disp 'Too few associated records!'
  err_struct.abs_drift{rn} = [];
  err_struct.abs_orient{rn} = [];
  err_struct.term_drift{rn} = [];
  err_struct.term_orient{rn} = [];
  err_struct.rel_drift{rn} = [];
  err_struct.rel_orient{rn} = [];
  err_struct.track_loss_rate(rn) = 1;
  err_struct.track_fit{rn} = [];
  err_struct.scale_fac(rn) = 1;
  return ;
end

% seq_duration = arr_data(end, 1) - arr_data(1, 1);
seq_end_time = arr_data(end, 1);

[err_struct.abs_drift{rn}, err_struct.abs_orient{rn}, ...
  err_struct.term_drift{rn}, err_struct.term_orient{rn}, ...
  err_struct.rel_drift{rn}, err_struct.rel_orient{rn}, ...
  err_struct.track_loss_rate(rn), err_struct.track_fit{rn}, ...
  err_struct.scale_fac(rn)] = ...
  getErrorMetric_align_mex(arr_data, arr_ref, arr_asso, ...
  asso_idx, min_match_num, step_length, fps, rel_interval, benchmark_type, ...
  rm_iso_track, seq_end_time, seq_start_time, valid_by_duration);

% [err_struct.abs_drift{rn}, err_struct.abs_orient{rn}, ...
%   err_struct.term_drift{rn}, err_struct.term_orient{rn}, ...
%   err_struct.rel_drift{rn}, err_struct.rel_orient{rn}, ...
%   err_struct.track_loss_rate(rn), err_struct.track_fit{rn}, ...
%   err_struct.scale_fac(rn)] = ...
%   getErrorMetric_align(arr_data, arr_ref, arr_asso, ...
%   asso_idx, min_match_num, step_length, fps, rel_interval, benchmark_type, ...
%   rm_iso_track, seq_duration, seq_start_time, valid_by_duration);

end